﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.PuzzleTopic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
צור\ ערוך חידת השבוע
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
   
<script src="../../Scripts/tinymce/jscripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
 <script type="text/javascript">
     

     tinyMCE.init({ theme: "advanced",
         mode: "exact",
         elements: "text",
         plugins: "",
         theme_advanced_buttons1_add_before: "forecolor,backcolor,copy,paste,fontselect", 
         theme_advanced_toolbar_location: "top",
         theme_advanced_toolbar_align: "left",
         theme_advanced_styles: "NormalBold 1=firstBold;Normal 2=first;Normal 3=second;", 
         theme_advanced_more_colors: true,
       
         content_css: "/Content/tinymce.css"
     });

    

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>צור\ ערוך חידת השבוע</h2>

   <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm(this.Model == null ? "CreatePuzzleTopic" : "EditPuzzleTopic", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
       {
    %>
    <fieldset>
      <%
            if (Model != null)
            {
        %>
        <input type="hidden" name="id" value="<%= Model.id %>" />
        <input type="hidden" name="publish" value="1" />
        <%
            }
        %>
            <legend>שדות:</legend>
            <p>
           <label for="title">כותרת</label>
                <%= Html.TextBoxFor(model => model.title) %>
                <%= Html.ValidationMessageFor(model => model.title) %>
            </p><p>
            <label for= "text">פתרון:</label>
            <%= Html.TextArea("text", new { rows = "15", cols = "80", id = "text" })%>
            
            
            </p>
            <p><label for="date">תאריך אחרון להצגה:</label><%= Html.TextBox("date") %> </p>
            <p><label for="solutionDate">תאריך להצגת הפיתרון:</label><%= Html.TextBox("solutionDate")%> </p>
       
           <p>
           <label for="image">תמונה:</label>
           <input type="file" name="image"/>
            <%
                if (this.Model != null && !string.IsNullOrEmpty(this.Model.image))
                {
                    Response.Write(string.Format("<img src='{0}' />", this.Model.image));
                }
            %>
           </p>
            <p>
                <input type="submit" value="שמור" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("חזרה לרשימה", "ListPuzzleTopic") %>
    </div>

</asp:Content>



